package iterator;

/**
 * <p>Title main</p>
 *
 * @author YiMing Liu
 * @date 2018/6/7 16:07
 * <p>Description:</p>
 */
public class main {

    public static void main(String[] args) {
        BookShelf bookShelf = new BookShelf(4);
        bookShelf.appendBook(new Book("1"));
        bookShelf.appendBook(new Book("2"));
        bookShelf.appendBook(new Book("3"));
        bookShelf.appendBook(new Book("4"));
        bookShelf.appendBook(new Book("5"));
        Iterator iterator = bookShelf.createIterator();
        while (iterator.hasNext()) {
            System.out.println(((Book) iterator.next()).getName());
        }


    }
}
